1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
| #include <bits/stdc++.h> #define ll long long using namespace std;
const int N = 310;
struct Point{ double x, y; Point(double _x = 0, double _y = 0):x(_x), y(_y) {} friend Point operator + (Point a, Point b){return Point(a.x+b.x, a.y+b.y);} friend Point operator - (Point a, Point b){return Point(a.x-b.x, a.y-b.y);} friend Point operator * (Point a, double b){return Point(a.x*b, a.y*b);} friend Point operator / (Point a, double b){return Point(a.x/b, a.y/b);} }origin;
Point p[N];
struct Segment{ int a, b; Point v;double An; Segment(int _a = 0, int _b = 0): a(_a), b(_b) {v = p[b]-p[a]; An = atan2(v.y, v.x);} friend bool operator < (Segment x, Segment y){return x.An < y.An;} }s[N * N];
int n, cnt;
ll f[N][N][7];
int main() { scanf("%d", &n); for(int i = 1; i <= n; i++) { double x, y; scanf("%lf%lf", &x, &y); p[i] = Point(x, y); } for(int i = 1; i <= n; i++) { for(int j = 1; j <= n; j++) { if(i == j)continue; s[++cnt] = Segment(i, j); } } sort(s+1, s+cnt+1); for(int i = 1; i <= n; i++) f[i][i][1] = 1; for(int k = 1; k <= cnt; k++) { int x = s[k].a; int y = s[k].b; for(int i = 1; i <= n; i++) for(int j = 1; j <= 5; j++) f[i][y][j+1] += f[i][x][j]; } ll ans = 0; for(int i = 1; i <= n; i++) ans += f[i][i][6]; printf("%lld", ans); return 0; }
|